#if HAVE_DOTNET
#dotnet_DIR = dotnet
#endif
dotnet_DIR = 

if HAVE_PYTHON
python_DIR = python
endif

if HAVE_EDS_BACKEND
eds_backend_DIR = eds-backend
endif

SUBDIRS = \
	po 				\
	libplanner			\
	src				\
	data				\
	docs				\
	examples			\
	tests				\
	$(python_DIR)			\
	$(dotnet_DIR)			\
	$(eds_backend_DIR)

EXTRA_DIST = \
	libplanner-1.pc			\
	libplanner-1.pc.in		\
	intltool-extract.in		\
	intltool-merge.in		\
	intltool-update.in

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libplanner-1.pc

DISTCHECK_CONFIGURE_FLAGS =		\
	--enable-gtk-doc		\
	--enable-database		\
	--disable-dotnet		\
	--enable-python			\
	--disable-scrollkeeper		\
	--disable-update-mimedb

# Workaround broken scrollkeeper that doesn't remove its files on
# uninstall. Same with the shared mime info, the generated files
# aren't empty when there is no mime data
distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollkeeper' | \
 grep -v '/share/mime/' | grep -v '/share/omf/planner'

DISTCLEANFILES = intltool-extract intltool-merge intltool-update 

dist-hook:
	@if test -d "$(srcdir)/.git"; \
	then \
		echo Creating ChangeLog && \
		( cd "$(top_srcdir)" && \
		  echo '# Generated by Makefile. Do not edit.'; echo; \
		  $(top_srcdir)/missing --run git log ) > ChangeLog.tmp \
		&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
		|| ( rm -f ChangeLog.tmp ; \
			echo Failed to generate ChangeLog >&2 ); \
	else \
		echo A git clone is required to generate a ChangeLog >&2; \
	fi
